package net.siufung.security.service.impl;

import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import net.siufung.core.result.ResultFail;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.security.oauth2.common.exceptions.UnsupportedGrantTypeException;

/**
 * @author 陈建峰
 * @since 2021/11/12 1:29 下午
 */
@Slf4j
@SuppressWarnings("deprecation")
@AllArgsConstructor
public class UserDetailsServiceImpl implements UserDetailsService {

    @Override
    public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
        throw new UnsupportedGrantTypeException(ResultFail.AUTH_INVALID_GRANT.getMessage());
    }

}
